from datetime import datetime,timedelta

now = datetime.now()

print(now)

dt = datetime(2015, 4, 19, 12, 20)

print(dt)
print(dt.timestamp())

mt=1429417200
print(datetime.fromtimestamp(mt))

print(datetime.utcfromtimestamp(mt)) # UTC时间

cday = datetime.strptime('2015-6-1 18:19:59', '%Y-%m-%d %H:%M:%S')
print(cday)

print(now.strftime('%a, %b %d %H:%M'))

now=now + timedelta(hours=10)
print(now.strftime('%Y-%m-%d %H:%M:%S'))

now=now + timedelta(days=1)
print(now.strftime('%Y-%m-%d %H:%M:%S'))

now=now + timedelta(days=2, hours=12)
print(now.strftime('%Y-%m-%d %H:%M:%S'))